Skip to content

Add higher_order_derivatives with cached mixed-partial reuse#118

Open
5iri wants to merge 1 commit intobrianguenter:mainfrom
5iri:feature/CachingHigherOrders
Open

Add higher_order_derivatives with cached mixed-partial reuse#118
5iri wants to merge 1 commit intobrianguenter:mainfrom
5iri:feature/CachingHigherOrders

Conversation

@5iri
Copy link

@5iri 5iri commented Jan 11, 2026

This PR adds a new higher-order differentiation path that reuses common intermediate derivative terms across orders instead of recomputing them by repeated calls to derivative. It introduces higher_order_derivatives (scalar + array) which computes full order‑k mixed partial tensors and optionally canonicalizes mixed partials (symmetric=true) to maximize reuse.

Performance (opt-in test)

Run: FD_PERF=1 julia --project -e 'using Pkg; Pkg.test()'
Observed speedups on this machine:

  • Examples/columnderivative.jl (1 var, order‑2): ~1.0× (expected minimal benefit)
  • Examples/hessian.jl: x^2+y^2+z^2 (order‑2): ~3.3×
  • Examples/hessian.jl: x*y*z (order‑2): ~3.0×

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant